package com.wandian.texas;

import com.wandian.admin.AdminCmdRequestor;

/**
 * @author long
 * @Create 2012-11-13 下午4:17:58
 * @QQ 108232706
 * @version 1.0
 * @description StopServer
 */
public class StopServer {

	public static void main(String[] args)
	{
		if (args.length < 4) {
			System.out.println("Aragment is wrong! eg config,serverType,serverId");
			return;
		}
		//		if (!Config.initConfig(args[0])) {
		//			Log.error("init server config fialed., server start failed.");
		//			return;
		//		}

		AdminCmdRequestor adminCmdRequestor = null;

		if ((args.length == 4) && ((args[3].equals("stop")) || (args[3].equals("stopnow")))) {
			String ip = "127.0.0.1";
			adminCmdRequestor = AdminCmdRequestor.connect(ip, 5555);
			if (adminCmdRequestor != null)
				adminCmdRequestor.send(args[3]);
		}
		else {
			System.out.println("参数不正确!");
		}
	}
}